package com.scoring.system.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.scoring.system.mapper.MajorMapper;
import com.scoring.system.pojo.Major;
import com.scoring.system.service.MajorService;
@Service("majorService")
public class MajorServiceImpl implements MajorService {
	
	@Resource
	private MajorMapper majorDao;

	@Override
	public int deleteMajor(int id) {
		return majorDao.deleteByPrimaryKey(id);
	}

	@Override
	public int saveMajor(Major record) {
		return majorDao.insert(record);
	}

	@Override
	public Major getMajorById(int id) {
		return majorDao.selectByPrimaryKey(id);
	}

	@Override
	public Major gerMajorByName(String name) {
		return majorDao.selectByName(name);
	}

	@Override
	public List<Major> listMajorByColleageId(int colleageId) {
		return majorDao.listMajorByColleageId(colleageId);
	}

	@Override
	public int updateMajor(Major record) {
		return majorDao.updateByPrimaryKeySelective(record);
	}

}
